package com.niuwa.p2p.core.enums;

/**
 * @author futianliang
 * @date 2015年4月15日
 */
public enum MessageTemplateEnum {
	/* p2p */
	phoneAuthCode("MBPP00001", "手机验证码"), registerSuccess("MBPP00002", "注册成功"), retailInvest("MBPP00003", "散户直投"), investPlan("MBPP00004", "投资计划"), subscriptionClaimSuccess("MBPP00005", "认购债权成功"), claimTranferAskPass(
			"MBPP00006", "债权转让申请通过"), claimTranferAskrefuse("MBPP00007", "债权转让申请拒绝"), investReturnMoney("MBPP00008", "直投回款"), investPlanReturnMoney("MBPP00009", "投资计划回款"), claimTranferSuccess(
			"MBPP00010", "债权转让成功"), loginFailForThreeTimes("MBPP00011", "登录失败3次"), loginFailForFiveTimes("MBPP00012", "登录失败5次"), updatePassword("MBPP00013", "修改密码"), resetPassword("MBPP00014", "重置密码"), askUpdatePhoneNo(
			"MBPP00015", "申请修改手机号"), refundRemaindForThreeDays("MBPP00016", "还款前三日提醒"), refundRemaindForOneDay("MBPP00017", "还款前一日提醒"), refundExpireDate("MBPP00018", "还款出现逾期"), aheadOfTimeRefund(
			"MBPP00019", "提前还款"), emailCheck("MBPP00020", "邮箱验证"), askUpdateEmail("MBPP00021", "申请修改邮箱"), gainRedEnvelope("MBPP00022", "获得红包"), redEnvelopeExpire("MBPP00023", "红包到期"), flowLabel(
			"MBPP00024", "流标"),
	/* app */
	checkPhoneNo("MBCS00001", "验证手机号"), customerRegister("MBCS00002", "用户注册"), mobileResetPassword("MBCS00003", "移动重置密码"), addFriendAsk("MBCS00004", "加好友申请"), littleRefundDayBeforRemain("MBCS00005",
			"小额还款日前提醒"), littleRefundDayRemain("MBCS00006", "小额还款日提醒"), littleExpireRemain("MBCS00007", "小额逾期提醒"), recivedRedEnvelopeForCash("MBCS00008", "收到现金红包"), recivedRefundOffsetRedEnvelope(
			"MBCS00009", "收到还款抵扣红包"), friendRecommend("MBCS00010", "好友推荐"),addFriendSuccess("MBCS00011","已添加好友"),littleLoanSuccess("MBCS00012","小额借款成功"),littleRufundSuccess("MBCS00013","小额还款成功"),littleLoanMessageCheck("MBCS00014","小额借款验证短信"),
	/* MC */
	faceSignRefused("MBMC00001", "面签拒绝");
	/* app手机端短信类型 */
	/*
	 * APP_REGISTER("MBCS00002", "手机注册"), FORGET_LOGIN_PASSWORD("MBCS00003",
	 * "忘记密码"), p2p端短信类型 BINDING("", "绑定"), VALIDATE_OLD_MOBILE("", "验证原始手机号码"),
	 * VALIDATE_NEW_MOBILE("", "验证新手机号码");
	 */

	private MessageTemplateEnum(String code, String name) {
		this.code = code;
		this.name = name;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	private String code;
	private String name;

	public static MessageTemplateEnum getEnum(String code) {
		for (MessageTemplateEnum t : MessageTemplateEnum.values()) {
			if (t.getCode().equals(code)) {
				return t;
			}
		}
		return null;

	}

	public static String getName(String code) {
		for (MessageTemplateEnum t : MessageTemplateEnum.values()) {
			if (t.getCode().equals(code)) {
				return t.name;
			}
		}
		return null;
	}
}
